package application;

import java.awt.BorderLayout;

import javax.swing.JFrame;

import universe.Game;
import display.GameDataDisplay;
import display.GameDisplay;
import display.Utils;

public class Tetris {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		JFrame oFrame = new JFrame();
		
		oFrame.setSize(display.Utils.getBoardWidthPx()+Utils.gameDataDisplayWidth, display.Utils.getBoardHeightPx());
		oFrame.setTitle("Wouah comment ça bug trop !");
		oFrame.setLayout(new BorderLayout());
		//oFrame.setResizable(false);	
		oFrame.setLocationRelativeTo(null);
		oFrame.setDefaultCloseOperation(3);
		
		
		Game laGame = new Game();
		
		
		GameDisplay oGameDisplay = new GameDisplay(laGame);
		GameDataDisplay oGameDataDisplay = new GameDataDisplay();
		
		oFrame.add(oGameDisplay, BorderLayout.CENTER);
		oFrame.add(oGameDataDisplay, BorderLayout.EAST);

		
		MenuTetris oMenuTetris = new MenuTetris(oFrame, laGame);

		
		oFrame.addKeyListener(new KeyTetris(laGame));

		
		oFrame.setVisible(true);
		laGame.run();
	}

}
